package com.example.demo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @ClassName:UserInfo
 * @Description:登录用户信息实体类
 * @Author:Deamer
 * @Date:2020/3/30 15:14
 **/
@Entity
@Table(name = "user_info")
@Data
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class UserInfo {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;//主键id
    private String username;//用户名
    private String password;//密码
    private Integer loginErrorCount = 0;//登录错误计数
    @CreatedDate
    private Date lastErrorTime;//最后一次登录错误时间
    private Integer loginLockFlag = 0;
}
